Namespaces

Functions

string|array|null
__(string|null $key = null, array $replace = [], string|null $locale = null)

Translate the given message.

never
abort(Response|Responsable|int $code, string $message = '', array $headers = [])

Throw an HttpException with the given data.

void
abort_if(bool $boolean, Response|Responsable|int $code, string $message = '', array $headers = [])

Throw an HttpException with the given data if the given condition is true.

void
abort_unless(bool $boolean, Response|Responsable|int $code, string $message = '', array $headers = [])

Throw an HttpException with the given data unless the given condition is true.

string
action(string|array $name, mixed $parameters = [], bool $absolute = true)

Generate the URL to a controller action.

mixed|Application
app(string|null $abstract = null, array $parameters = [])

Get the available container instance.

string
app_path(string $path = '')

Get the path to the application folder.

array
append_config(array $array)

Assign high numeric IDs to a config item to force appending.

string
asset(string $path, bool|null $secure = null)

Generate an asset path for the application.

auth(string|null $guard = null)

Get the available auth instance.

back(int $status = 302, array $headers = [], mixed $fallback = false)

Create a new redirect response to the previous location.

string
base_path(string $path = '')

Get the path to the base of the install.

string
bcrypt(string $value, array $options = [])

Hash the given value against the bcrypt algorithm.

bool
blank(mixed $value)

Determine if the given value is "blank".

broadcast(mixed|null $event = null)

Begin broadcasting an event.

mixed|CacheManager
cache()

Get / set the specified cache value.

string
class_basename(string|object $class)

Get the class "basename" of the given object / class.

array
class_uses_recursive(object|string $class)

Returns all traits used by a class, its parent classes and trait of their traits.

collect(mixed $value = null)

Create a collection from the given value.

mixed|Repository
config(array|string|null $key = null, mixed $default = null)

Get / set the specified configuration value.

string
config_path(string $path = '')

Get the configuration path.

csrf_field()

Generate a CSRF token form field.

string
csrf_token()

Get the CSRF token value.

mixed
data_fill(mixed $target, string|array $key, mixed $value)

Fill in data where it's missing.

mixed
data_get(mixed $target, string|array|int|null $key, mixed $default = null)

Get an item from an array or object using "dot" notation.

mixed
data_set(mixed $target, string|array $key, mixed $value, bool $overwrite = true)

Set an item on an array or object using dot notation.

string
database_path(string $path = '')

Get the database path.

mixed
decrypt(string $value, bool $unserialize = true)

Decrypt the given value.

dispatch(mixed $job)

Dispatch a job to its appropriate handler.

mixed
dispatch_now(mixed $job, mixed $handler = null)
deprecated

Dispatch a command to its appropriate handler in the current process.

mixed
dispatch_sync(mixed $job, mixed $handler = null)

Dispatch a command to its appropriate handler in the current process.

string
e(DeferringDisplayableValue|Htmlable|string|null $value, bool $doubleEncode = true)

Encode HTML special characters in a string.

string
elixir(string $file, string $buildDirectory = 'build')
deprecated

Get the path to a versioned Elixir file.

string
encrypt(mixed $value, bool $serialize = true)

Encrypt the given value.

mixed
env(string $key, mixed $default = null)

Gets the value of an environment variable.

array|null
event(...$args)

Dispatch an event and call the listeners.

FactoryBuilder
factory(string $class, int $amount = null)

Create a model factory builder for a given class and amount.

bool
filled(mixed $value)

Determine if a value is "filled".

mixed
head(array $array)

Get the first element of an array. Useful for method chaining.

void
info(string $message, array $context = [])

Write some information to the log.

string
lang_path(string $path = '')

Get the path to the language folder.

mixed
last(array $array)

Get the last element from an array.

LogManager|null
logger(string|null $message = null, array $context = [])

Log a debug message to the logs.

LogManager|LoggerInterface
logs(string|null $driver = null)

Get a log driver instance.

method_field(string $method)

Generate a form field to spoof the HTTP verb used by forms.

HtmlString|string
mix(string $path, string $manifestDirectory = '')

Get the path to a versioned Mix file.

now(DateTimeZone|string|null $tz = null)

Create a new Carbon instance for the current time.

mixed
object_get(object $object, string|null $key, mixed $default = null)

Get an item from an object using "dot" notation.

mixed
old(string|null $key = null, mixed $default = null)

Retrieve an old input item.

mixed
optional(mixed $value = null, callable $callback = null)

Provide access to optional objects.

mixed
policy(object|string $class)

Get a policy instance for a given class.

string
preg_replace_array(string $pattern, array $replacements, string $subject)

Replace a given pattern with each value in the array in sequentially.

string
public_path(string $path = '')

Get the path to the public folder.

redirect(string|null $to = null, int $status = 302, array $headers = [], bool|null $secure = null)

Get an instance of the redirector.

void
report(Throwable|string $exception)

Report an exception.

Request|string|array|null
request(array|string|null $key = null, mixed $default = null)

Get an instance of the current request or an input item from the request.

mixed
rescue(callable $callback, mixed $rescue = null, bool $report = true)

Catch a potential exception and return a default value.

mixed
resolve(string $name, array $parameters = [])

Resolve a service from the container.

string
resource_path(string $path = '')

Get the path to the resources folder.

response(View|string|array|null $content = '', int $status = 200, array $headers = [])

Return a new response from the application.

mixed
retry(int $times, callable $callback, int|Closure $sleepMilliseconds = 0, callable|null $when = null)

Retry an operation a given number of times.

string
route(array|string $name, mixed $parameters = [], bool $absolute = true)

Generate the URL to a named route.

string
secure_asset(string $path)

Generate an asset path for the application.

string
secure_url(string $path, mixed $parameters = [])

Generate a HTTPS url for the application.

session(array|string|null $key = null, mixed $default = null)

Get / set the specified session value.

string
storage_path(string $path = '')

Get the path to the storage folder.

mixed
tap(mixed $value, callable|null $callback = null)

Call the given Closure with the given value then return the value.

mixed
throw_if(mixed $condition, Throwable|string $exception = 'RuntimeException', mixed ...$parameters)

Throw the given exception if the given condition is true.

mixed
throw_unless(mixed $condition, Throwable|string $exception = 'RuntimeException', mixed ...$parameters)

Throw the given exception unless the given condition is true.

today(DateTimeZone|string|null $tz = null)

Create a new Carbon instance for the current date.

array
trait_uses_recursive(string $trait)

Returns all traits used by a trait and its traits.

Translator|string|array|null
trans(string|null $key = null, array $replace = [], string|null $locale = null)

Translate the given message.

string
trans_choice(string $key, Countable|int|array $number, array $replace = [], string|null $locale = null)

Translates the given message based on a count.

mixed|null
transform(mixed $value, callable $callback, mixed $default = null)

Transform the given value if it is present.

UrlGenerator|string
url(string|null $path = null, mixed $parameters = [], bool|null $secure = null)

Generate a url for the application.

validator(array $data = [], array $rules = [], array $messages = [], array $customAttributes = [])

Create a new Validator instance.

mixed
value(mixed $value, ...$args)

Return the default value of the given value.

view(string|null $view = null, Arrayable|array $data = [], array $mergeData = [])

Get the evaluated view contents for the given view.

bool
windows_os()

Determine whether the current environment is Windows based.

mixed
with(mixed $value, callable $callback = null)

Return the given value, optionally passed through the given callback.